<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>添加分类</title>
    <div th:replace="admin/_fragments-admin::basicrefrence"></div>

</head>


<!--网页主体-->
<body>

    <!--网页头-->
    <nav th:replace="admin/_fragments-admin::nav"></nav>
    <div th:replace="admin/_fragments-admin::Seconednav"></div>


    <div style="padding-top: 46px;padding-bottom: 200px">
        <div class="ui container">
            <form class="ui form">
                <div class="field">
                    <input id="type" type="text" placeholder="类型"/>
                </div>

                <div class="ui right aligned container">
                    <button id="btn" class="ui teal button" type="button">提交</button>
                </div>
            </form>
        </div>
    </div>



    <footer th:replace="admin/_fragments-admin::footer"></footer>


</body>

<script type="text/javascript">


    $('.ui.dropdown').dropdown();


    $("#btn").click(function () {
        var name = $("#type").val();
        if (name != ''){
            $.ajax({
                url:"/admin/addAType",
                data:{
                    name:name
                },
                dataType:"text",
                success:function (resp) {
                    alert(resp);
                }
            });
        }
    });


</script>

</html>